<h1> Categories </h1>
<ul class="cat_list">
  <% @categories.each do |c| %>

    <li><%= link_to( 'Edit', edit_category_path(c.id), :class => "button") %> <%= link_to( 'Delete', delete_category_path(c.id), :class => "button") %><h3><%= link_to( c.name, show_category_posts_path(c.id) ) %></h3><%if !c.parent_id.nil? %><h3>[Parent: <%= link_to( get_category_name(c.parent_id), show_category_posts_path( c.parent_id ) ) %>] </h3><%end%></li>

  <% end %>
</ul>
<%= link_to( 'New', new_category_path(), :class => "button") %>